package com.guiji.text2video.job.util;

/**
 * @Copyright (C), 2018-2021
 * @FileName: DouyinHuman
 * @Author: scl
 * @Date: 2021/11/4 15:53
 * @Description: 抖音-数字人
 */
public class DouyinHuman {

    /**
     * @descp: 数字人参数拼接，合成请求参数
     * @param:
     * @Author: scl
     * @Date: 2021/11/3 17:45
     */

    public static String getBoliStadio(String nginxFront, String name) {
        String wavNginx = nginxFront + "cache/" + name + ".wav";
        String videoNginx = nginxFront + "cache/" + name + ".mp4";
        String videoRequest =
                "{\n" +
                        "  \"sentences\": [\n" +
                        "    {\n" +
                        "      \"images\": [],\n" +
                        "      \"sentences\": [\n" +
                        "        \"   \"\n" +
                        "      ],\n" +
                        "      \"index\": 1,\n" +
                        "      \"videos\": [\n" + "\"" + videoNginx + "\"" +
                        "      ],\n" +
                        "      \"params\": {},\n" +
                        "      \"duration\": 0,\n" +
                        "      \"wavs\": [\n" + "\"" + wavNginx + "\"" +
                        "      ],\n" +
                        "      \"isTitle\": false,\n" +
                        "      \"firstImgId\": []\n" +
                        "    }\n" +
                        "  ],\n" +
                        "  \"millseconds\": 0,\n" +
                        "  \"title\": \"微软研发出玻璃硬盘\",\n" +
                        "  \"taskId\": \"" + name + "\",\n" +
                        "  \"dhBgGrn\": \"http://172.16.160.54/text2video/news/nfs/duix-cc/zip/lb.jpg\",\n" +
                        "  \"dhUdCode\": \"slomon_stand\",\n" +
                        "  \"dhBgImg\": \"http://172.16.160.54/text2video/news/nfs/duix-cc/zip/174159074311671808.jpg\",\n" +
                        "  \"dhSequence\": [\n" +
                        "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/yuehan/yuehan_up.mp4\"\n" +
                        "  ],\n" +
                        "  \"input_overlay_paths\": [\n" +
                        "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/douyin/boli-moban.png\",\n" +
                        "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/douyin/black.jpg\",\n" +
                        "    \"::video\",\n" +
                        "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/douyin/boli-biankuang.png\",\n" +
                        "    \"::DigitalMan\"\n" +
                        "  ],\n" +
                        "  \"x_coordinates\": [\n" +
                        "    0,\n" +
                        "    160,\n" +
                        "    500,\n" +
                        "    95,\n" +
                        "    1400\n" +
                        "  ],\n" +
                        "  \"y_coordinates\": [\n" +
                        "    0,\n" +
                        "    70,\n" +
                        "    75,\n" +
                        "    15,\n" +
                        "    130\n" +
                        "  ],\n" +
                        "  \"scales\": [\n" +
                        "    \"\",\n" +
                        "    \"1200:740\",\n" +
                        "    \"576:730\",\n" +
                        "    \"1320:880\",\n" +
                        "    \"540:960\"\n" +
                        "  ],\n" +
                        "  \"is_loops\": [\n" +
                        "    false,\n" +
                        "    false,\n" +
                        "    false,\n" +
                        "    false,\n" +
                        "    false\n" +
                        "  ],\n" +
                        "  \"title_of_film\": [\n" +
                        "  ],\n" +
                        "  \"end_of_film\": [\n" +
                        "  ]\n" +
                        "}";
        return videoRequest;
    }


    /**
     * @descp: 科技频道使用二创参数。
     * @param:
     * @Author: scl
     * @Date: 2021/11/5 14:31
     */
    public static String getKejiSplitVideo(String videoUrl){

        String result="{\"cut_type\":1,\"h\":780,\"cut_pos\":130,\"path\":\""+videoUrl+"\",\"w\":-1,\"x\":0,\"y\":80}";

        return result;
    }

    public static String getKeji(String nginxFront, String name) {
        String wavNginx = nginxFront + "cache/" + name + ".wav";
        String videoNginx = nginxFront + "cache/" + name + ".mp4";
        String videoRequest ="{\n" +
                "  \"sentences\": [\n" +
                "    {\n" +
                "      \"images\": [],\n" +
                "      \"sentences\": [\n" +
                "        \"   \"\n" +
                "      ],\n" +
                "      \"index\": 1,\n" +
                "      \"videos\": [\n" +
                "        \"" + videoNginx + "\"\n" +
                "      ],\n" +
                "      \"params\": {},\n" +
                "      \"duration\": 0,\n" +
                "      \"wavs\": [\n" +
                "        \"" + wavNginx + "\"\n" +
                "      ],\n" +
                "      \"isTitle\": false,\n" +
                "      \"firstImgId\": []\n" +
                "    }\n" +
                "  ],\n" +
                "  \"millseconds\": 0,\n" +
                "  \"title\": \"为航天事业做出巨大贡献\",\n" +
                "  \"taskId\": \"" + name + "\",\n" +
                "  \"dhBgGrn\": \"http://172.16.160.54/text2video/news/nfs/duix-cc/zip/lb.jpg\",\n" +
                "  \"dhUdCode\": \"yy\",\n" +
                "  \"dhBgImg\": \"http://172.16.160.54/text2video/news/nfs/duix-cc/zip/174159074311671808.jpg\",\n" +
                "  \"dhSequence\": [\n" +
                "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/yy/yy.mp4\"\n" +
                "  ],\n" +
                "  \"input_overlay_paths\": [\n" +
                "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/douyin/boli-moban1.png\",\n" +
                "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/douyin/boli-biankuang1.png\",\n" +
                "    \"::video\",\n" +
                "    \"::DigitalMan\"\n" +
                "  ],\n" +
                "  \"x_coordinates\": [\n" +
                "    0,\n" +
                "    600,\n" +
                "    950,\n" +
                "    50\n" +
                "  ],\n" +
                "  \"y_coordinates\": [\n" +
                "    0,\n" +
                "    15,\n" +
                "    75,\n" +
                "    130\n" +
                "  ],\n" +
                "  \"scales\": [\n" +
                "    \"\",\n" +
                "    \"1280:860\",\n" +
                "    \"576:720\",\n" +
                "    \"540:960\"\n" +
                "  ],\n" +
                "  \"is_loops\": [\n" +
                "    false,\n" +
                "    false,\n" +
                "    false,\n" +
                "    false\n" +
                "  ],\n" +
                "  \"title_of_film\": [\n" +
                "  ],\n" +
                "  \"end_of_film\": [\n" +
                "  ],\n" +
                "  \"scene\": \"演播厅\",\n" +
                "  \"characterInfo\": {\n" +
                "    \"uvScale\": 0.5,\n" +
                "    \"offsetU\": 1.157491,\n" +
                "    \"ofssetV\": -0.152381,\n" +
                "    \"buttomCutting\": 0.0\n" +
                "  }\n" +
                "}";

        return videoRequest;
    }


    /**
     * @descp: 育儿频道使用二创参数。
     * @param: 
     * @Author: scl
     * @Date: 2021/11/5 14:31
     */
    public static String getYuErSplitVideo(String videoUrl){

        String result="{\"cut_type\":1,\"h\":780,\"cut_pos\":250,\"path\":\""+videoUrl+"\",\"w\":-1,\"x\":0,\"y\":80}";

        return result;
    }

    public static String getYanshuhanYuEr(String nginxFront, String name) {
        String wavNginx = nginxFront + "cache/" + name + ".wav";
        String videoNginx = nginxFront + "cache/" + name + ".mp4";
        String videoRequest ="{\n" +
                "  \"sentences\": [\n" +
                "    {\n" +
                "      \"images\": [],\n" +
                "      \"sentences\": [\n" +
                "        \"   \"\n" +
                "      ],\n" +
                "      \"index\": 1,\n" +
                "      \"videos\": [\n" +
                "        \"" + videoNginx + "\"" +
                "      ],\n" +
                "      \"params\": {},\n" +
                "      \"duration\": 10301,\n" +
                "      \"wavs\": [\n" +
                "        \"" + wavNginx + "\"" +
                "      ],\n" +
                "      \"isTitle\": false,\n" +
                "      \"firstImgId\": []\n" +
                "    }\n" +
                "  ],\n" +
                "  \"millseconds\": 99662,\n" +
                "  \"title\": \"为航天事业做出巨大贡献\",\n" +
                "  \"taskId\": \"" + name + "\",\n" +
                "  \"dhBgGrn\": \"http://172.16.160.54/text2video/news/nfs/duix-cc/zip/lb.jpg\",\n" +
                "  \"dhUdCode\": \"ysh_sit\",\n" +
                "  \"dhBgImg\": \"http://172.16.160.54/text2video/news/nfs/duix-cc/zip/174159074311671808.jpg\",\n" +
                "  \"dhSequence\": [\n" +
                "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/yangshuhan/ysh_sit.mp4\"\n" +
                "  ],\n" +
                "  \"input_overlay_paths\": [\n" +
                "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/yangshuhan/yuer-black.png\",\n" +
                "    \"http://172.16.160.54/text2video/news/nfs/duix-cc/yangshuhan/kuang2.png\",\n" +
                "    \"::video\",\n" +
                "    \"::DigitalMan\"\n" +
                "  ],\n" +
                "  \"x_coordinates\": [\n" +
                "    0,\n" +
                "    700,\n" +
                "    1045,\n" +
                "    50\n" +
                "  ],\n" +
                "  \"y_coordinates\": [\n" +
                "    0,\n" +
                "    50,\n" +
                "    54,\n" +
                "    -150\n" +
                "  ],\n" +
                "  \"scales\": [\n" +
                "    \"\",\n" +
                "    \"1100:900\",\n" +
                "    \"450:550\",\n" +
                "    \"750:1300\"\n" +
                "  ],\n" +
                "  \"is_loops\": [\n" +
                "    false,\n" +
                "    false,\n" +
                "    false,\n" +
                "    false\n" +
                "  ],\n" +
                "  \"title_of_film\": [\n" +
                "  ],\n" +
                "  \"end_of_film\": [\n" +
                "  ]\n" +
                "}";
        return videoRequest;
    }


}